package com.coocaa.ops.admin.v1.auth.sys.biz.impl;


import com.coocaa.ops.admin.v1.auth.sys.biz.ISysRoleMenuRunBiz;
import com.coocaa.ops.admin.v1.auth.sys.mapper.ISysRoleMenuRunMapper;
import com.coocaa.ops.common.core.base.BaseBizImpl;
import com.coocaa.ops.common.core.biz.auth.entity.SysRoleMenuRunEntity;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author bijiahao
 * @date : 2019/3/18.
 * @description
 */
@Service
public class SysRoleMenuRunBizImpl extends BaseBizImpl<ISysRoleMenuRunMapper, SysRoleMenuRunEntity> implements ISysRoleMenuRunBiz {


    @Override
    public void saveBatch(Integer roleId, List<SysRoleMenuRunEntity> menuRuns) {
        getMapper().deleteByRoleId(roleId);
        getMapper().addBatch(menuRuns);
    }


    /**
     * 查询所有数据
     *
     * @param params
     * @return
     */
    @Override
    public List<SysRoleMenuRunEntity> queryAll(Map<String, Object> params) {
        if (null == params) {
            params = new HashMap<>(0);
        }
        return getMapper().queryAll(params);
    }
}
